package com.ryl.yomall.user.controller;

import com.ryl.yomall.model.common.result.Result;
import com.ryl.yomall.model.user.UserInfo;
import com.ryl.yomall.user.mapper.UserInfoMapper;
import org.apache.ibatis.annotations.Param;
import org.aspectj.lang.annotation.AfterThrowing;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Date 19:30
 * @Author ryl
 */
@RestController
@RequestMapping("/api/user")
public class WxUserController {
    @Autowired
    private UserInfoMapper userInfoMapper;
    @PostMapping("/addWxUser/{nickName}")
    public Result addWxUser(@PathVariable String nickName){

        UserInfo userInfo=new UserInfo ();
        userInfo.setName ( nickName );
        userInfo.setNickName (  nickName);
        userInfo.setLoginName ( nickName );
        userInfo.setPasswd ( "123" );
        userInfo.setPhoneNum ( "123" );
        userInfo.setUserLevel ( "1" );
        userInfoMapper.insert ( userInfo );
        return Result.ok ();
    }
}
